#!/usr/bin/python2
# -*- coding: utf8 -*-
from PyQt4 import QtCore, QtGui, Qt, QtDeclarative
import sys

class Date(QtCore.QObject):

    currentDateTimeChange = QtCore.pyqtSignal()
    timer = QtCore.QTimer();

    def __init__(self, parent=None):
        QtCore.QObject.__init__(self, parent)
        self._day = 0
        self.timer.start(1000)
        self.timer.timeout.connect(self.onTimeout)

    def onTimeout(self):
        self.currentDateTimeChange.emit()

    def getCurrentTimeInSeconds(self):
        return QtCore.QDateTime.currentDateTime().toTime_t()

    currentTimeInSeconds = QtCore.pyqtProperty("int", fget=getCurrentTimeInSeconds, notify=currentDateTimeChange)
